package com.ftg.learn.back;

/**
 * @author KangJx
 * @date 2021/7/22
 */
public class LengthEx {

    int[] as;
    int index = 0;

    public LengthEx(){
        as = new int[10];
    }

    public void add(int o){
        if(index == as.length){
            int[] as1 = new int[as.length + (as.length >> 1)];
            System.arraycopy(as,0,as1,0,as.length);
            as = as1;
        }

        as[index++] = o;
    }

}
